﻿#include "SupplyProperty.h"

SupplyProperty::SupplyProperty(const int MinTime, const int MaxTime, const int Steplen, const QString ModelName)
:MinTime(MinTime),
MaxTime(MaxTime),
Steplen(Steplen),
ModelName(ModelName)
{
	if (MinTime >= MaxTime)
	{
		OutInfo;
		qWarning() << "Mixtime:" << MinTime << ">=MaxTime:" << MaxTime;
	}
	setUpTime();
}

SupplyProperty::SupplyProperty(const SupplyProperty& in)
{
	operator=(in);
}

void SupplyProperty::operator=(const SupplyProperty& in)
{
	Timer.setInterval(in.Timer.interval());
	MinTime = in.MinTime;
	MaxTime = in.MaxTime;
	Steplen = in.Steplen;
	ModelName = in.ModelName;
}

void SupplyProperty::setUpTime()
{
	Timer.setInterval(random(MinTime, MaxTime));
}

SupplyProperty& SupplyProperty::getQuoteThis()
{
	return *this;
}
